{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "5257c103",
   "metadata": {},
   "source": [
    "------------\n",
    "* 日期：2022-08-31 \\ week02（周三）\n",
    "* 课程：python\n",
    "* 记录人：zhou\n",
    "------------\n",
    "\n",
    "# 本周学习内容\n",
    "\n",
    "## 1.准备工作\n",
    "\n",
    "> 1. 安装配置Python环境 （anaconda，清华大学镜像）\n",
    ">> 1. 什么是绝对路径和相对路径？\n",
    ">> 2. 配置环境，相对路径有5个需要配置的，绝对路径根据自己的电脑进行配置\n",
    "\n",
    "> 2. 回顾：GitHub Desktop 如何实现本地与云端的链接\n",
    ">> 1. 克隆Gitee的仓库URL，到本地的制定文件路径，例如 D:/2022-2023/Python\n",
    ">> 2. 上传 本地笔记到gitee仓库\n",
    "\n",
    "> 3. 本周重点知识（[jupyter notebook](https://jupyter.org/))\n",
    ">> 1. 什么是IDE？（即集成开发环境）\n",
    ">> 2. 如何打开jupyter notebook ？\n",
    ">>> 1. cmd\n",
    ">>> 2. cd 指定目录下\n",
    ">>> 3. 输入： jupyter notebook\n",
    "\n",
    "> 4. 注：前九周全部使用jopyter notebook（IDE）来做课堂和课后练习\n",
    "\n",
    "## 2.模块（工具箱-不需要知道怎么做的，只需要会用就可以了）\n",
    "\n",
    "> 1. 标准库（python团队自己开发出来的，想着有人如果用我的编程语言的话，常用的一些功能我已经准备好了）\n",
    ">> 1. 使用标准库的方法，import 模块名称\n",
    ">> 2. 标准库的库\n",
    "> 2. 开源模块(anaconda为例)\n",
    ">> 1. 开源模块\n",
    "> 3. 自定义模块"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "7142c612",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hello world~\n"
     ]
    }
   ],
   "source": [
    "print(\"hello world~\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "a8dc628d",
   "metadata": {},
   "outputs": [],
   "source": [
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "6e38984f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time.struct_time(tm_year=2022, tm_mon=9, tm_mday=7, tm_hour=13, tm_min=0, tm_sec=38, tm_wday=2, tm_yday=250, tm_isdst=0)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.localtime()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "34c8e63e",
   "metadata": {},
   "outputs": [
    {
     "ename": "ModuleNotFoundError",
     "evalue": "No module named 'apple'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mModuleNotFoundError\u001b[0m                       Traceback (most recent call last)",
      "Input \u001b[1;32mIn [4]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mapple\u001b[39;00m\n",
      "\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'apple'"
     ]
    }
   ],
   "source": [
    "import apple"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5b55ff00",
   "metadata": {},
   "outputs": [],
   "source": [
    "from detetime import detetime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1a89fb80",
   "metadata": {},
   "outputs": [],
   "source": [
    "odds = [ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19,\n",
    "        21, 23, 25, 27, 29, 31, 33, 35, 37, 39,\n",
    "        41, 43, 45, 47, 49, 51, 53, 55, 57, 59]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "25caf387",
   "metadata": {},
   "outputs": [],
   "source": [
    "right_this_minute = datetime.today().minute"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "34fbdbd5",
   "metadata": {},
   "outputs": [],
   "source": [
    "if right_this_minute in odds:\n",
    "    print(\"This minute seems a little odd.\")\n",
    "    else:\n",
    "        print(\"Not an odd minute.\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "60e90ec1",
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "99190883",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'win32'"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sys.platform"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "a5b91c67",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3.9.12 (main, Apr  4 2022, 05:22:27) [MSC v.1916 64 bit (AMD64)]\n"
     ]
    }
   ],
   "source": [
    "print(sys.version)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "be3142f3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "C:\\Users\\10727\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "print(os.path.abspath(' . '))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "ec7ef3f3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'C:\\\\Users\\\\10727'"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "os.getcwd()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "53a6caea",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "environ{'ACSVCPORT': '17532',\n",
       "        'ALLUSERSPROFILE': 'C:\\\\ProgramData',\n",
       "        'APPDATA': 'C:\\\\Users\\\\10727\\\\AppData\\\\Roaming',\n",
       "        'COMMONPROGRAMFILES': 'C:\\\\Program Files\\\\Common Files',\n",
       "        'COMMONPROGRAMFILES(X86)': 'C:\\\\Program Files (x86)\\\\Common Files',\n",
       "        'COMMONPROGRAMW6432': 'C:\\\\Program Files\\\\Common Files',\n",
       "        'COMPUTERNAME': 'LAPTOP-9OS7FADD',\n",
       "        'COMSPEC': 'C:\\\\Windows\\\\system32\\\\cmd.exe',\n",
       "        'CONDA_DEFAULT_ENV': 'base',\n",
       "        'CONDA_EXE': 'E:\\\\anaconda3\\\\Scripts\\\\conda.exe',\n",
       "        'CONDA_PROMPT_MODIFIER': '(base) ',\n",
       "        'CONDA_PYTHON_EXE': 'E:\\\\anaconda3\\\\python.exe',\n",
       "        'CONDA_SHLVL': '1',\n",
       "        'DRIVERDATA': 'C:\\\\Windows\\\\System32\\\\Drivers\\\\DriverData',\n",
       "        'FPS_BROWSER_APP_PROFILE_STRING': 'Internet Explorer',\n",
       "        'FPS_BROWSER_USER_PROFILE_STRING': 'Default',\n",
       "        'HOMEDRIVE': 'C:',\n",
       "        'HOMEPATH': '\\\\Users\\\\10727',\n",
       "        'INTEL_DEV_REDIST': 'C:\\\\Program Files (x86)\\\\Common Files\\\\Intel\\\\Shared Libraries\\\\',\n",
       "        'LOCALAPPDATA': 'C:\\\\Users\\\\10727\\\\AppData\\\\Local',\n",
       "        'LOGONSERVER': '\\\\\\\\LAPTOP-9OS7FADD',\n",
       "        'MIC_LD_LIBRARY_PATH': 'C:\\\\Program Files (x86)\\\\Common Files\\\\Intel\\\\Shared Libraries\\\\compiler\\\\lib\\\\mic',\n",
       "        'NUMBER_OF_PROCESSORS': '12',\n",
       "        'ONEDRIVE': 'C:\\\\Users\\\\10727\\\\OneDrive',\n",
       "        'OS': 'Windows_NT',\n",
       "        'PATH': 'E:\\\\anaconda3;E:\\\\anaconda3\\\\Library\\\\mingw-w64\\\\bin;E:\\\\anaconda3\\\\Library\\\\usr\\\\bin;E:\\\\anaconda3\\\\Library\\\\bin;E:\\\\anaconda3\\\\Scripts;E:\\\\anaconda3\\\\bin;E:\\\\anaconda3\\\\condabin;E:\\\\anaconda3;E:\\\\anaconda3\\\\Library\\\\mingw-w64\\\\bin;E:\\\\anaconda3\\\\Library\\\\usr\\\\bin;E:\\\\anaconda3\\\\Library\\\\bin;E:\\\\anaconda3\\\\Scripts;C:\\\\Program Files (x86)\\\\Common Files\\\\Intel\\\\Shared Libraries\\\\redist\\\\intel64\\\\compiler;C:\\\\Windows\\\\system32;C:\\\\Windows;C:\\\\Windows\\\\System32\\\\Wbem;C:\\\\Windows\\\\System32\\\\WindowsPowerShell\\\\v1.0;C:\\\\Windows\\\\System32\\\\OpenSSH;C:\\\\Program Files (x86)\\\\NVIDIA Corporation\\\\PhysX\\\\Common;C:\\\\Program Files\\\\NVIDIA Corporation\\\\NVIDIA NvDLISR;E:\\\\Anaconda;E:\\\\Anaconda\\\\Scripts;E:\\\\Anaconda\\\\Library\\\\mingw-w64\\\\bin;E:\\\\Anaconda\\\\Library\\\\user\\\\bin;E:\\\\Anaconda\\\\Library\\\\bin;E:\\\\anaconda3;E:\\\\anaconda3\\\\Library\\\\mingw-w64\\\\bin;E:\\\\anaconda3\\\\Library\\\\usr\\\\bin;E:\\\\anaconda3\\\\Library\\\\bin;E:\\\\anaconda3\\\\Scripts;C:\\\\Users\\\\10727\\\\AppData\\\\Local\\\\Microsoft\\\\WindowsApps;D:\\\\QQGameTempest\\\\Hall.57773;C:\\\\Users\\\\10727\\\\AppData\\\\Local\\\\GitHubDesktop\\\\bin;.',\n",
       "        'PATHEXT': '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC',\n",
       "        'PROCESSOR_ARCHITECTURE': 'AMD64',\n",
       "        'PROCESSOR_IDENTIFIER': 'AMD64 Family 23 Model 96 Stepping 1, AuthenticAMD',\n",
       "        'PROCESSOR_LEVEL': '23',\n",
       "        'PROCESSOR_REVISION': '6001',\n",
       "        'PROGRAMDATA': 'C:\\\\ProgramData',\n",
       "        'PROGRAMFILES': 'C:\\\\Program Files',\n",
       "        'PROGRAMFILES(X86)': 'C:\\\\Program Files (x86)',\n",
       "        'PROGRAMW6432': 'C:\\\\Program Files',\n",
       "        'PROMPT': '(base) $P$G',\n",
       "        'PSMODULEPATH': 'C:\\\\Program Files\\\\WindowsPowerShell\\\\Modules;C:\\\\Windows\\\\system32\\\\WindowsPowerShell\\\\v1.0\\\\Modules',\n",
       "        'PUBLIC': 'C:\\\\Users\\\\Public',\n",
       "        'QT_DEVICE_PIXEL_RATIO': 'auto',\n",
       "        'RLSSVCPORT': '22112',\n",
       "        'SESSIONNAME': 'Console',\n",
       "        'SYSTEMDRIVE': 'C:',\n",
       "        'SYSTEMROOT': 'C:\\\\Windows',\n",
       "        'TEMP': 'C:\\\\Users\\\\10727\\\\AppData\\\\Local\\\\Temp',\n",
       "        'TMP': 'C:\\\\Users\\\\10727\\\\AppData\\\\Local\\\\Temp',\n",
       "        'USERDOMAIN': 'LAPTOP-9OS7FADD',\n",
       "        'USERDOMAIN_ROAMINGPROFILE': 'LAPTOP-9OS7FADD',\n",
       "        'USERNAME': '10727',\n",
       "        'USERPROFILE': 'C:\\\\Users\\\\10727',\n",
       "        'WINDIR': 'C:\\\\Windows',\n",
       "        'CONDA_PREFIX': 'E:\\\\anaconda3',\n",
       "        'CONDA_ROOT': 'E:\\\\anaconda3',\n",
       "        'PYDEVD_USE_FRAME_EVAL': 'NO',\n",
       "        'JPY_INTERRUPT_EVENT': '3164',\n",
       "        'IPY_INTERRUPT_EVENT': '3164',\n",
       "        'JPY_PARENT_PID': '3168',\n",
       "        'TERM': 'xterm-color',\n",
       "        'CLICOLOR': '1',\n",
       "        'PAGER': 'cat',\n",
       "        'GIT_PAGER': 'cat',\n",
       "        'MPLBACKEND': 'module://matplotlib_inline.backend_inline'}"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "os.environ"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "e024b37f",
   "metadata": {},
   "outputs": [],
   "source": [
    "os.getenv('HOME')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "a30bfdce",
   "metadata": {},
   "outputs": [],
   "source": [
    "import datetime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "5226d857",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.date(2022, 9, 7)"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.date.today()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "2b15b0fb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "7"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.date.today().day"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "d0cb66d6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2022-09-07'"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.date.isoformat(datetime.date.today())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "90529438",
   "metadata": {},
   "outputs": [],
   "source": [
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "107662d2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'13:21'"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.strftime(\"%H:%M\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "b5d7ee3e",
   "metadata": {},
   "outputs": [],
   "source": [
    "import html"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "989b72d2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'This HTML fragment contains a &lt;script&gt;script&lt;/script&gt;tag.'"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "html.escape(\"This HTML fragment contains a <script>script</script>tag.\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "3c3b9d72",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'I ♥ 网三 &It;standard library>.'"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "html.unescape(\"I &hearts; 网三 &It;standard library&gt;.\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f91a6924",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
